using System;
using System.Windows.Forms;

namespace IppServer.Host.Tools
{
    /// <summary>
    /// 诊断工具入口
    /// </summary>
    public static class DiagnosticTool
    {
        public static void RunDiagnostic(string printerUri)
        {
            var report = IppClientDiagnostic.DiagnosePrinterAsync(printerUri).Result;
            
            // 显示诊断报告
            var form = new Form
            {
                Text = "IPP 打印机诊断报告",
                Width = 800,
                Height = 600,
                StartPosition = FormStartPosition.CenterScreen
            };
            
            var textBox = new TextBox
            {
                Multiline = true,
                ReadOnly = true,
                ScrollBars = ScrollBars.Both,
                Dock = DockStyle.Fill,
                Font = new System.Drawing.Font("Consolas", 9),
                Text = report
            };
            
            form.Controls.Add(textBox);
            form.ShowDialog();
        }
    }
}


